#include <stdio.h>
#include <math.h>
#include <time.h>
int main()
{
int i=1,j=0,a,M=0,m=100,x=0,p=0;
float K,k=1,y=0,q=0;
srand((unsigned)time(NULL));
for(j=0;j<100;j++)
{
a=rand()%100;
if(M<=a)M=a;
if(K<=(1.0/a))K=(1.0/a);
if(k>=(1.0/a))k=(1.0/a);
if(m>=a)m=a;
printf("%d %d %f\n",i,a,1.0/a);
i++;
x=x+a;
y=y+(1.0/a);
}
p=x/100;
q=y/100;
printf("max %d %f\n",M,K);
printf("min %d %f\n",m,k);
printf("ave %d %f\n",p,q);
return 0;
}
